<?php

namespace common\components;

class Common{

	/**
	 * 得到颜色
	 */
	public static function getRightColor($right){
		$color = '#000';
		if($right < 1){
			$color = '#FF0000';
		}else if($right < 2){
			$color = '#E00';
		}else if($right < 3){
			$color = '#D00';
		}else if($right < 4){
			$color = '#C00';
		}else if($right < 5){
			$color = '#B00';
		}else if($right < 6){
			$color = '#A10';
		}else if($right < 7){
			$color = '#920';
		}else if($right < 8){
			$color = '#830';
		}else if($right < 9){
			$color = '#740';
		}else if($right < 10){
			$color = '#650';
		}else if($right < 11){
			$color = '#560';
		}else if($right < 12){
			$color = '#470';
		}else if($right < 13){
			$color = '#380';
		}else if($right < 14){
			$color = '#290';
		}else if($right < 15){
			$color = '#1A0';
		}else if($right < 16){
			$color = '#0B0';
		}else{
			$color = '#0C0';
		}
		return $color;
	}

	/**
	 * 得到锁定时间
	 * @param $right
	 * @return int
	 */
	public static function getLocktime($right){
		if($right <4){
			$locktime = 8*3600;
		}else if($right <8){
			$locktime = 16*3600;
		}else if($right <16){
			$locktime = 64*3600;
		}else if($right <24){
			$locktime = 7*24*3600;
		}else{
			$locktime = 30*24*3600;
		}
		return $locktime;
	}

}

?>